/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.financeiro.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "proposta_modelo", catalog = "salao", schema = "public")
@NamedQueries({
    @NamedQuery(name = "PropostaModelo.findAll", query = "SELECT p FROM PropostaModelo p")})
public class PropostaModelo implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "proposta_modelo_id_modelo_seq")
    @SequenceGenerator(name = "proposta_modelo_id_modelo_seq", sequenceName = "proposta_modelo_id_modelo_seq", initialValue = 1, allocationSize = 1)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_modelo", nullable = false)
    private Integer idModelo;
    @Size(max = 200)
    @Column(name = "dsc_modelo", length = 200)
    private String dscModelo;
    //@Size(max = 2147483647)
    @Column(name = "modelo", columnDefinition="text")
    private String modelo;
    
    @JoinColumn(name = "id_etapa", referencedColumnName = "id_etapa")
    @ManyToOne
    private PropostaEtapa idEtapa;

    public PropostaModelo() {
    }

    public PropostaModelo(Integer idModelo) {
        this.idModelo = idModelo;
    }

    public Integer getIdModelo() {
        return idModelo;
    }

    public void setIdModelo(Integer idModelo) {
        this.idModelo = idModelo;
    }

    public String getDscModelo() {
        return dscModelo;
    }

    public void setDscModelo(String dscModelo) {
        this.dscModelo = dscModelo;
    }

    public String getModelo() {
        return modelo;
    }

    public void setModelo(String modelo) {
        this.modelo = modelo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idModelo != null ? idModelo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PropostaModelo)) {
            return false;
        }
        PropostaModelo other = (PropostaModelo) object;
        if ((this.idModelo == null && other.idModelo != null) || (this.idModelo != null && !this.idModelo.equals(other.idModelo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.financeiro.entity.PropostaModelo[ idModelo=" + idModelo + " ]";
    }

    public PropostaEtapa getIdEtapa() {
        return idEtapa;
    }

    public void setIdEtapa(PropostaEtapa idEtapa) {
        this.idEtapa = idEtapa;
    }
    
}
